var upImgQiniu = {
		/*
			uptoken : 上传凭证 从后台获得
			filename ：上传图片的名字
			upImgBtn : 上传图片按钮Id值
			showImgBox :显示图片的位置盒子
		*/
	qiniuImg:function(uptoken,filename,upImgBtn,showImgBox){
	    var uploader = Qiniu.uploader({
	        runtimes: 'html5,flash,html4',
	        browse_button: upImgBtn,
	        dragdrop: true,
	        chunk_size: '4mb',
	        // uptoken_url: $('#uptoken_url').val(),
	        uptoken:uptoken,
	        filters : {
	            max_file_size : '100000mb',
	            prevent_duplicates: true,
	            mime_types: [
	            ]
	        },
	        domain: 'z2',
	        get_new_uptoken: false,
	        unique_names: false,
	        auto_start: true,
	        log_level: 5,
	        init: {
	            'FilesAdded': function(up, files) {
	                $('table').show();
	                $('#success').hide();
	                plupload.each(files, function(file) {
	                    var progress = new FileProgress(file, 'fsUploadProgress');
	                    progress.setStatus("等待...");
	                    progress.bindUploadCancel(up);
	                });
	            },
	            'BeforeUpload': function(up, file) {
	                var progress = new FileProgress(file, 'fsUploadProgress');
	                var chunk_size = plupload.parseSize(this.getOption('chunk_size'));
	                if (up.runtime === 'html5' && chunk_size) {
	                    progress.setChunkProgess(chunk_size);
	                }
	            },
	            'UploadProgress': function(up, file) {
	                var progress = new FileProgress(file, 'fsUploadProgress');
	                var chunk_size = plupload.parseSize(this.getOption('chunk_size'));
	                progress.setProgress(file.percent + "%", file.speed, chunk_size);
	            },
	            'UploadComplete': function(res,files) {
	            	// for(var a = 0 ; a < files.length ; a ++){

	            	// }
	            	var key = files[0].name.split('.')[1];
	                key = filename+"."+key;
	                $('#'+showImgBox).attr('src','http://img.3ccg.com/'+key)
	            },
	            'FileUploaded': function(up, file, info) {

	                var progress = new FileProgress(file, 'fsUploadProgress');
	                progress.setComplete(up, info);
	            },
	            'Error': function(up, err, errTip) {
	               	console.log(err);
	                var progress = new FileProgress(err.file, 'fsUploadProgress');
	                progress.setError();
	                progress.setStatus(errTip);
	            }
	            ,
	            'Key': function(up, files) {
	            	var key = files.name.split('.')[1];
	                key = filename+"."+key;
	                return key
	            }
	        }
	    });
	}
}